import React, {Component} from 'react'
import MusicItem from './music-item.jsx'

const MusicDefault = ({selected, selectMusic, curSrc, play, pause}) => {
    let {id, filename, src} = window.DEFAULT_SONG;
    return (
            <li className={selected && selected.id && id === selected.id ? 'selected-music' : null}>
            <span className="music-name" onClick={selectMusic.bind(null, window.DEFAULT_SONG)}>
                使用默认音乐
                {selected && selected.id && id === selected.id ? '(已选中)' : null}
            </span>
            {curSrc !== undefined && src === curSrc
                ? <button className="music-wp-play" key={1} onClick={pause}><i className="fa fa-pause" aria-hidden="true"></i></button>
                : <button className="music-wp-play" key={3} onClick={ev => {ev.preventDefault(); play(src)}}><i className="fa fa-play-circle" aria-hidden="true"></i></button>
            }
        </li>   
    )
}

export default MusicDefault